package com.ruoyi.blog.mapper;

import com.ruoyi.blog.domain.BlogArticle;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * Created by lf on 2020/12/20.
 */
public interface BlogArticleMapper {
    int addNewArticle(BlogArticle article);

    int updateArticle(BlogArticle article);

    List<BlogArticle> getArticleList(BlogArticle article);

    int updateArticleState(@Param("aids") Long aids[], @Param("state") Integer state);

    int updateArticleStateById(@Param("articleId") Integer articleId, @Param("state") Integer state);

    int deleteArticleById(@Param("aids") Long[] aids);

    BlogArticle getArticleById(Long aid);

    void pvIncrement(Long aid);

    //INSERT INTO pv(countDate,pv,uid) SELECT NOW(),SUM(pageView),uid FROM article GROUP BY uid
    void pvStatisticsPerDay();

    List<String> getCategories(Long uid);

    List<Integer> getDataStatistics(Long uid);
}
